package main

import (
	_ "360video/video-srv/handler/init"
	__ "360video/video-srv/handler/proto"
	"360video/video-srv/service/service"
	"flag"
	"fmt"
	"google.golang.org/grpc"
	"log"
	"net"
)

// var (
//
//	port = flag.Int("port", 50051, "The server port")
//
// )
//
// // server is used to implement helloworld.GreeterServer.

func main() {
	flag.Parse()
	lis, err := net.Listen("tcp", fmt.Sprintf("127.0.0.1:8082"))
	if err != nil {
		log.Fatalf("failed to listen: %v", err)
	}
	s := grpc.NewServer()
	__.RegisterVideoServer(s, &service.Server{})
	log.Printf("server listening at %v", lis.Addr())
	if err := s.Serve(lis); err != nil {
		log.Fatalf("failed to serve: %v", err)
	}
}
